import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '../views/login.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: login
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home.vue'),
    redirect:'/hello',
    children:[
      {
         path:'/hello',
         name: 'hello',
         component: () => import('../views/hello.vue')
      },
      {
        path: '/users',
        name: 'users',
        component: () => import('../views/users.vue')
      },
      {
        path: '/roles', 
        name: 'roles',
        component: () => import('../views/roles.vue')
      },
      {
        path: '/rights', 
        name: 'rights',
        component: () => import('../views/rights.vue')
      },
      {
        path: '/goods', 
        name: 'goods',
        component: () => import('../views/goods.vue')
      },
      {
        path: '/add', 
        name: 'add',
        component: () => import('../views/add.vue')
      },
      {
        path: '/params', 
        name: 'params',
        component: () => import('../views/params.vue')
      },
      {
        path: '/categories', 
        name: 'categories',
        component: () => import('../views/categories.vue')
      },
      {
        path: '/orders', 
        name: 'orders',
        component: () => import('../views/orders.vue')
      },
      {
        path: '/reports', 
        name: 'reports',
        component: () => import('../views/reports.vue')
      },
      {
        path: '/adds', 
        name: 'adds',
        component: () => import('../views/adds.vue')
      },
    ]
  },
  
]

const router = new VueRouter({
  routes
})

export default router
